<template>
  <view id="all">
    <view class="shdz" :key="item.phone" v-for="item in addressList">
      <text id="address">{{item.address}}</text> <br>
      <text id="name">{{item.name}}</text>
      <text id="phone">{{item.phone}}</text>
    </view>
    <navigator url="../xzdz/xzdz">
      <view id="button">
      <button>添加收货地址</button>
      </view>
    </navigator>
  </view>
</template>

<script>
export default {
  name:"shdz",
  data() {
    return {
      addressList: []
    };
  },
  created() {
      let _this = this;
      uni.request({
        url: "http://123.57.67.148:3000/mock/42/PostShdzData",
        method: "post",
        success(res) {
          _this.addressList = res.data.data;
          console.log(_this.addressList)
        }
      });
    }
}
</script>

<style scoped>
  #all{
    width: 100%;
    display: flex;
    flex-direction:column;
    margin: auto;
  }
  .shdz{
    width: 100%;
    height: 4rem;
    border-bottom:1px solid gray; 
    padding: 1rem 0
  }
  #address{
    padding: 0 1rem;
    font-size: 1.2rem
  }
  #phone{
    padding: 0 1rem;
    color: gray
  }
  #name{
    padding:1rem;
    color: gray
  }
  #button{
    padding: 1rem
  }
  #button button{
    width: 80%;
    background-color: forestgreen;
    text-align: center;
    color: white;
    border-radius: 2rem
  }
</style>
